package com.bjpowernode.crm.commons.constant;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

/**
 * ClassName:demo
 * Package:com.bjpowernode.crm.commons.constant
 * Date:2022/6/1 20:33
 * Description:
 * Author:zsm@zhangshuming.com
 */
public class demo {
    public static void main(String[] args) {
       /* // 当前时间
        DateTime date1 = DateUtil.date();
        // 当前时间加一天
        DateTime tomorrow = DateUtil.tomorrow();
        // 当前时间加一天的开始时间：00点00分00秒
        Date beginOfDay = DateUtil.beginOfDay(tomorrow);

        //这里若date1和date2换位置，输出结果不变：betweenDay = 3
        long betweenDay = DateUtil.between(date1, beginOfDay, DateUnit.SECOND);
        System.out.println(betweenDay);*/
        Date beginOfDay = DateUtil.beginOfDay(DateUtil.tomorrow());
        long betweenDay = DateUtil.between(DateUtil.date(), beginOfDay, DateUnit.SECOND);
        System.out.println(betweenDay);
    }
}
